<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:f="http://java.sun.com/jsf/core" 
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:ez="http://java.sun.com/jsf/composite/ezcomp"> 

    <h:head> 
        <title>SABM</title> 

        <style type="text/css"> 

            .gritter-notice-wrapper { 
                left:200px; 
                top:50px; 
            } 
        </style> 

    </h:head> 
    <h:body>                 
        <ez:TCubeAdminTopMenu/>

        <h1>Stakeholder Account and Billing Management</h1> 


        <p:layout style="table-layout:auto; height:500px ">
            <p:layoutUnit position="left" header="Navigation" width="300">
                <h:form id="SABMTCubeAdminSM">
                        <h:commandLink value="Add Stakeholder" action="/TCubeAdmin/SABM_SM/addStakeholder.xhtml?faces-redirect=true"/>
                    <br/>
                    <h:commandLink value="Delete Stakeholder" action="/TCubeAdmin/SABM_SM/deleteStakeholder.xhtml?faces-redirect=true"/>
                    <br/>
                    <h:commandLink value="Change Stakeholder Tier" action="/TCubeAdmin/SABM_SM/changeStakeholderTier.xhtml?faces-redirect=true"/>
                    <br/>
                    <h:commandLink value="Create Stakeholder Tier" action="/TCubeAdmin/SABM_SM/createNewTier.xhtml?faces-redirect=true"/>
                    <br/>
                     <h:commandLink value="Delete Stakeholder Tier" action="/TCubeAdmin/SABM_SM/deleteTier.xhtml?faces-redirect=true"/>
                    <br/>
                    <h:commandLink value="Modify Tier Information" action="/TCubeAdmin/SABM_SM/modifyTier.xhtml?faces-redirect=true"/>
                    <br/>
                </h:form>
            </p:layoutUnit>
            <p:layoutUnit position="center" header="Settings">
                <h2>Create New Tier</h2>
                <h:form>
                    <p:panel id="panel" >
                    <p:ajaxStatus style="width:16px;height:16px;">
                    <f:facet name="start">
                        <h:graphicImage value="http://www.primefaces.org:8080/showcase/design/ajaxloading.gif" />
                    </f:facet>
                    <f:facet name="complete">
                        <h:outputText value="" />
                    </f:facet>
                </p:ajaxStatus>
                <p:messages />
                <h:panelGrid columns="3">
                    <h:outputLabel for="name" style="font-weight: bold" value="Tier Name: " />
                    <h:inputText required="true" label="Tier Name" requiredMessage="Tier Name is required." id="name" value="#{tierManagerBean.name}">
                    </h:inputText>
                    <p:message for="name" />
                    <h:outputLabel for="commissionPercent" style="font-weight: bold" value="Commission Percentage: " />
                    <h:inputText required="true" label="Commission Percentage" requiredMessage="Commission Percentage is required." id="commissionPercent" value="#{tierManagerBean.commissionPercent}">                        
                    </h:inputText>
                    <p:message for="commissionPercent" />
                    <h:outputLabel for="feeSubscription" style="font-weight: bold" value="Fee subcription: " />
                    <h:inputText required="true" label="Fee subcription" requiredMessage="Subscription Fee is required." id="feeSubscription" value="#{tierManagerBean.feeSubscription}">
                        
                    </h:inputText>
                    <p:message for="feeSubscription" />
                    <h:outputLabel for="feeMarketIntelligence" style="font-weight: bold" value="Market Intelligenge Fee: " />
                    <h:inputText required="true" label="Market Intelligenge Fee" requiredMessage="Market Intelligenge Fee is required." id="feeMarketIntelligence" value="#{tierManagerBean.feeMarketIntelligence}">
                        
                    </h:inputText>
                    <p:message for="feeMarketIntelligence" />
                    <h:outputLabel for="costPerClick" style="font-weight: bold" value="Cost Per Click: " />
                    <h:inputText required="true" label="Cost Per Click" requiredMessage="Cost Per Click is required." id="costPerClick" value="#{tierManagerBean.costPerClick}">
                        
                    </h:inputText>
                    <p:message for="costPerClick" />
                </h:panelGrid>
                <h:commandButton id="btn" value="Create New Tier" onclick="if (!confirm('Are you sure you want to create new tier?')) return false"
                                    action="#{tierManagerBean.createNewTier(event)}"
                                    />
                                             
            </p:panel>
                </h:form>
                <br/>
                <br/>
                
            </p:layoutUnit>
        </p:layout>
        
    </h:body> 
</html>